import { CreateOpsWebApp } from '@/utils/fetch';

const request = CreateOpsWebApp();

export const story_list = async (params) => {
  return request.post('/tapd/story/list', params);
};

export const deleteRelationApi = async (params) => {
  return request.post('/tapd/story/deleteRelation', params);
};

export const updateReviewApi = async (params) => {
  return request.post('/tapd/story/updateReview', params);
};

export const codeCheckApi = async (params) => {
  return request.post('/tapd/story/codeCheck', params);
};

export const getProjectsApi = async (params) => {
  return request.get('/tapd/story/getProjects', params);
};

export const updateRelationApi = async (params) => {
  return request.post('/tapd/story/updateRelation', params);
};

export const updateStoryApi = async (params) => {
  return request.post('/tapd/story/update', params);
};

export const addStoryApi = async (params) => {
  return request.post('/tapd/story/addStory', params);
};

export const getEnvUnionApi = async (params) => {
  return request.post('/tapd/story/getEnvUnion', params);
};

export const createMergeBranchApi = async (params) => {
  return request.post('/tapd/story/createMergeBranch', params);
};

export const updateMergeStatusApi = async (params) => {
  return request.post('/tapd/story/updateMergeStatus', params);
};

// 获取排期计划
export const getScheduleApi = async (params) => {
  return request.get('/tapd/story/getSchedule', params);
};

// 加锁
export const getLockStatusApi = async (params) => {
  return request.post('/tapd/story/isLock', params);
};

// 关闭排期计划
export const closeScheduleApi = async (params) => {
  return request.post('/tapd/story/closeLock', params);
};

// 获取锁状态
export const getOnLockApi = async (params) => {
  return request.get('/tapd/story/getLockStatus', params);
};

// 提交排期计划
export const submitScheduleApi = async (params) => {
  return request.post('/tapd/story/setSchedule', params);
};

export default {};
